package com.health.hfm;

import com.health.common.swagger.annotation.EnableHealthSwagger2;
import com.health.core.annotation.EnableHealthAop;
import com.health.hfm.sys.config.HfmEnterpriseConfigService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import com.health.hfm.sys.filter.AccessFilter;

@SpringBootApplication
@EnableDiscoveryClient
@EnableHealthSwagger2
@EnableHealthAop
@MapperScan("com.health.hfm.mapper")
@ServletComponentScan(basePackageClasses = AccessFilter.class)
public class HealthHFMApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(HealthHFMApplication.class);
    }

    @Autowired
    HfmEnterpriseConfigService enterpriseConfigService;

    // 初始化企业配置信息
    @Override
    public void run(String... args){
        enterpriseConfigService.initialize();
    }

}
